<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="../template/template.xhtml">

	<ui:define name="body">
		<f:view>
			<h:form>
				<rich:panel>
					<f:facet name="header">
						<h:outputText value="Lista de Projetos" />
					</f:facet>
					
					<!-- filtros -->
					<rich:toolBar height="34" itemSeparator="line">
						<rich:toolBarGroup>
							<h:outputLabel value="Nome:" />
							<h:inputText id="nome" value="#{projetoController.projeto.nome}"/>
						</rich:toolBarGroup>
		
						<rich:toolBarGroup>
							<h:outputLabel value="Status:" />
							<h:selectOneMenu id="status" value="#{projetoController.projeto.statusProjeto}" immediate="true">
								<f:selectItems value="#{projetoController.allStatus}" />
							</h:selectOneMenu>
						</rich:toolBarGroup>
						
						<rich:toolBarGroup location="right" style="width:180px;">
							<h:commandButton value="Consultar" action="#{projetoController.buscarProjetos}" />
						</rich:toolBarGroup>
					</rich:toolBar>
		
					<br/>
							
					<!-- lista -->
					<rich:dataTable value="#{projetoController.projetos}" var="projeto" binding="#{projetoController.dataTable}" width="100%">
						<rich:column width="20%">
							<f:facet name="header">
								<h:outputLabel value="Nome" />
							</f:facet>
							<h:outputText value="#{projeto.nome}" />
						</rich:column>
					
						<rich:column width="30%">
							<f:facet name="header">
								<h:outputLabel value="Descricao" />
							</f:facet>
							<h:outputText value="#{projeto.descricao}" />
						</rich:column>
						
						<rich:column width="20%">
							<f:facet name="header">
								<h:outputLabel value="Data Criacao" />
							</f:facet>
							<h:outputText value="#{projeto.displayDataCriacao}" />
						</rich:column>
						
						<rich:column width="20%">
							<f:facet name="header">
								<h:outputLabel value="Data Termino" />
							</f:facet>
							<h:outputText value="#{projeto.displayDataCriacao}" />
						</rich:column>
						
						<rich:column width="10%">
							<f:facet name="header">
								<h:outputLabel value="Acoes" />
							</f:facet>
							<center>
								<a4j:commandButton value="Editar" action="#{projetoController.editarProjeto}" />
							</center>	
						</rich:column>
					</rich:dataTable>
				</rich:panel>

				<br/>
		            
		        <div align="center" style="width: 100%;"><h:outputText id="message" style="color: red;" value="#{projetoController.message}"/></div>
		            
		        <br/>				
				
			</h:form>
		</f:view>	
	</ui:define>

</ui:composition>
